<template>
  <div>
    <p>
      未完成任务数量：{{ list.filter((item) => item.done == false).length }}
    </p>
    <p>未完成任务数量：{{ num }}</p>
  </div>
</template>

<script>
export default {
  components: {},
  props: {},
  data() {
    return {
      list: [
        { id: 1, name: "吃饭", done: true },
        { id: 2, name: "睡觉", done: false },
        { id: 3, name: "打豆豆", done: false },
      ],
    };
  },
  computed: {
    num() {
      return this.list.filter((item) => item.done === false).length;
    },
  },
  watch: {},
  created() {},
  methods: {},
};
</script>

<style scoped></style>
